#include <lwan/lwan.h>
#include <lwan/lwan-mod-serve-files.h>
#include "controller/user_mgr.h"
#include "controller/msg_mgr.h"
#include "controller/orders_mgr.h"

int main(void)
{
    
    const struct lwan_url_map default_map[] = {
      
        { .prefix = "/hop/api/user_mgr", .handler = LWAN_HANDLER_REF(user_mgr) },
        { .prefix = "/hop/api/msg_mgr", .handler = LWAN_HANDLER_REF(msg_mgr) },
        { .prefix = "/hop/api/orders_mgr", .handler = LWAN_HANDLER_REF(orders_mgr) },
        { .prefix = NULL }
    };
    struct lwan l;

    lwan_init(&l);
    model_init();
    lwan_set_url_map(&l, default_map);
    lwan_main_loop(&l);
    lwan_shutdown(&l);
   model_close();
    return 0;
}
